<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>添加/修改供应商信息</title>
<c:import url="/ctrl/simpleheader"></c:import>
<script type="text/javascript" src="/scripts/supplier/detail.js"></script>
</head>
<body>
  <div title="供应商信息">
    <div style="padding: 10px 0 10px 60px">
      <table>
        <tr>
          <td>供应商:</td>
          <td><c:choose>
              <c:when test="${supplier!=null}">
                <c:out value="${supplier.supName}" />
              </c:when>
              <c:otherwise>
                <input type="text" id="name" name="name"
                  style="width: 160px;"></input>
              </c:otherwise>
            </c:choose></td>
        </tr>
        <tr>
          <td>类型:</td>
          <td><select id="type" name="type"><option
                value=""></option>
              <c:forEach var="type" items="${typeList}">
                <option value="<c:out value="${type.index}" />"
                  <c:if test="${supplier.supType==type.index}">selected="selected"</c:if>><c:out
                    value="${type.name}" /></option>
              </c:forEach></select></td>
        </tr>
        <tr>
          <td>状态:</td>
          <td><c:forEach var="status" items="${statusList}">
              <input type="radio" name="status"
                value="<c:out
                      value="${status.index}" />"
                <c:if test="${status.index==supplier.supStatus}"> checked="checked"</c:if>>
              <c:out value="${status.name}" />&nbsp;
          </c:forEach></td>
        </tr>
      </table>
    </div>
    <div style="text-align: center; padding: 5px">
      <c:choose>
        <c:when test="${supplier!=null}">
          <a href="javascript:void(0)"
            onclick="submitModify('<c:out
              value="${supplier.supId}" />')">保存</a>
        </c:when>
        <c:otherwise>
          <a href="javascript:void(0)" onclick="submitCreate()">添加供应商</a>
        </c:otherwise>
      </c:choose>
    </div>
  </div>
</body>
</html>